home *** CD-ROM | disk | FTP | other *** search
- /* InspectTuple by Paul Kunz October 1991
- * The supervisor for the tuple inspection panel
- *
- * Copyright (C) 1991 The Board of Trustees of
- * The Leland Stanford Junior University. All Rights Reserved.
- */
-
- #define INSPECTTUPLE_H_ID "$Id: InspectTuple.h,v 1.17 1992/04/13 18:02:48 pfkeb Rel $"
-
- #import "InspectBase.h"
- #import "hippo.h"
-
- #define HD_OK 0
- #define HD_NOTEXIST -2
- #define HD_CANCEL -1
- #define HD_REPLACE 1
-
- @interface InspectTuple:InspectBase
- {
- id openPanel; /* global OpenPanel object */
- id accessoryView; /* accessory View for OpenPanel */
- id msgMatrix; /* Matrix of TextFields for message */
- id refFlagMatrix; /* radio button Matrix */
- id tupleBrowser; /* NXBrowser showing tuple titles */
- id fileForm; /* Form to hold info on file */
- id tupleList; /* List for opened tuples */
- id tmpTupleList; /* List used temporary for re-opening file */
- ntuple selectedTuple; /* The last selected tuple */
- }
- -addTuple:(ntuple) nt;
- /*
- * Creates a new HTuple object as a handler for the externally created
- * ntuple nt, add it to the list of handlers and returns the id of it.
- */
-
- - initInspFor:aDraw;
- /*
- * Initalizes an object for the global controler aDraw.
- * And adds itself to the NewInspector list.
- */
-
- - openTuple:sender;
- /* Opens new binary tuple
- */
-
- - openTupleAsText:sender;
- /* Opens new text tuple
- */
-
- - openTupleFile;
- /*
- * Opens the tuple file selected by the OpenPanel. This method
- * does not run the OpenPanel, rather it is called after it has been run.
- */
-
- - (int) runModelForTypes;
- /*
- * Runs the openPanel to select tuple binary file with suffix .hippo.
- * Returns HD_OK on success, HD_CANCEL if user canceled.
- */
-
- - (int) openTupleFile:(const char *)filename by:(BOOL) refFlag;
- /*
- * Opens new tuples from file filename.
- * The by reference flag for the tuple is set by value of refFlag.
- * Checks if tuple with the same filename already is opened.
- * Returns HD_OK on success, HD_CANCEL if user canceled, or
- * HD_REPLACE if user wants to replace open tuple with one in file.
- */
-
- - openAltTupleFile:(const char *)filename;
- /*
- * Runs the OpenPanel to select a file to replace filename and
- * opens the selected n-tuple file. The altfilename of the
- * opened Tuples is set to filename. This method is used
- * when opening a document with tuples by reference, and the
- * ntuple file has changed it's path or doesn't exists
- */
-
- - openTupleFromFile:(const char *)filename by:(BOOL)refFlag;
- /*
- * Opens ntuple file filename and returns a List of
- * HTuple objects created or nil if file could not be opened.
- * The refFlag is passed to each HTuple object.
- */
-
- - openTuple:pasteBoard
- userData:(const char *)args
- error:(char **)errorMsg;
- /*
- * Opens an ascii n-tuple from the pasteboard
- */
-
- - newTuple:(ntuple) nt;
- /* Adds a new tuple to the tupleList List object.
- * Do not use this method, use addTuple: instead.
- */
-
- - (BOOL) isNewTupleFile:(const char *)filename;
- /* return YES if tuple file with filename is not in list of
- * currently opened files, otherwise returns NO.
- */
-
- - hTupleForTuple:(ntuple) nt;
- /*
- * Returns the HTuple object managing the ntuple nt, or
- * nil if none found.
- */
-
- - hTupleForFile:(const char *)filename index:(int)intValue;
- /*
- * Returns the HTuple object that manages the intValue-th ntuple in
- * file filename, or nil if none found.
- */
-
- - tupleListForFile:(const char *) filename;
- /*
- * returns a List object containing HTuple objects whose
- * n-tuple is from filename.
- */
-
- - setTuple:(ntuple) atuple;
- /* Sets the tuple with already prepared display held by this object
- */
-
- - (ntuple) currentTuple;
- /* Returns the currently selected tuple
- */
-
- - currentHTuple;
- /*
- * Returns the currently selected HTuple object or
- * nil if none is selected.
- */
-
- - bindDisplays;
- /*
- * Sends bindDisplays message to each DrawDocument View. Used
- * when replacing a n-tuple file.
- */
-
- - updateView;
- /*
- * Updates the contents of the Inspector's View
- */
-
- - closeTupleFile:(const char *)filename;
- /*
- * Close an n-tuple file after informing each DrawDocument's View
- * that file is about to close.
- */
-
- - showPanel;
- /*
- * Orders the NewInspector panel to show the Tuple List and brings
- * Panel front
- */
-
- - addTuplesIfAbsent:newList for:aView;
- /*
- * Adds the HTuples contain in the List newList to the tuple List
- * maintained by the receiving object if they are absent.
- * Informs aView of replacement HTuples. Frees
- * and HTuples in newList that are duplicates.
- */
-
- - select:sender;
- /* Responds to OK button on tupleInspPanel by selecting possible new
- * tuple as the selected tuple and ordering out the panel
- */
-
- - replace:sender;
- /*
- * Responds to the Replace button on tupleInspPanel by sending replace
- * tuple message to the graphics view
- */
-
- - close:sender;
- /*
- * Responds to the Close Button by closing the n-tuple after
- * informing all DrawDocument Views.
- */
-
- - browserSelect:sender;
- /* Responds to selection in the tuple Browser.
- */
-
- - (int) browser: sender fillMatrix: matrix inColumn: (int) column;
- /* delegate method for NXBrowser that displays titles of active tuples
- */
- - setMsgMatrix:anObject;
- /*
- * Receives the id of the message matrix and clears the text
- * set by the Interface Builder
- */
- @end
-